//
// Copyright (C) 2011 - 2013  Steve Channell steve.channell@cepheis.com
//
// This file is part of Cephei.QL, an open-source library wrapper 
// arround QuantLib http://quantlib.org/
//
// Cephei.QL is open source software: you can redistribute it and/or modify it
// under the terms of the license.  You should have received a
// copy of the license along with this program; if not, please email
// <support@cepheis.com>. The license is also available online at
// <http://cepheis.com/license.htm>.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE.  See the license for more details.
//
// Version 2.2 with QuantLib 1.2.1
//#include "stdafx.h"
#include "MixedLinearFritschButlandCubic.h"
using namespace Cephei::QL::Math::Interpolations;
#include <gen/QL/Math/Interpolations/MixedLinearCubicInterpolation.h>
#undef HANDLE
#undef ABSTRACT
#undef STRUCT
Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::CMixedLinearFritschButlandCubic (boost::shared_ptr<QuantLib::MixedLinearFritschButlandCubic>& childNative, Object^ owner) : CMixedLinearCubicInterpolation(CMixedLinearFritschButlandCubic::typeid)
{
#ifdef HANDLE
	_phMixedLinearFritschButlandCubic = NULL;
#endif
	_ppMixedLinearFritschButlandCubic = &childNative;
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearFritschButlandCubic));
}
Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::CMixedLinearFritschButlandCubic (QuantLib::MixedLinearFritschButlandCubic& childNative, Object^ owner) : CMixedLinearCubicInterpolation(CMixedLinearFritschButlandCubic::typeid)
{
#ifdef HANDLE
	_phMixedLinearFritschButlandCubic = NULL;
#endif
	_ppMixedLinearFritschButlandCubic = new boost::shared_ptr<QuantLib::MixedLinearFritschButlandCubic> (&childNative);
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearFritschButlandCubic));
    _MixedLinearFritschButlandCubicOwner = owner;
    _MixedLinearCubicInterpolationOwner = owner;
}

Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::CMixedLinearFritschButlandCubic (CMixedLinearFritschButlandCubic^ copy) : CMixedLinearCubicInterpolation(CMixedLinearFritschButlandCubic::typeid)
{
#ifdef HANDLE
	_phMixedLinearFritschButlandCubic = NULL;
#endif
	if (copy->HasNative() != NULL)
    {
		_ppMixedLinearFritschButlandCubic = new boost::shared_ptr<QuantLib::MixedLinearFritschButlandCubic> (copy->GetShared());
        _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearFritschButlandCubic));
    }
}
Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::CMixedLinearFritschButlandCubic (PLATFORM::Type^ t) : CMixedLinearCubicInterpolation(CMixedLinearFritschButlandCubic::typeid)
{
#ifdef HANDLE
	_phMixedLinearFritschButlandCubic = NULL;
#endif
	if (!t->IsSubclassOf(CMixedLinearFritschButlandCubic::typeid))
		throw REFNEW Exception ("Invalid base-case init");
}
#ifdef HANDLE
Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::CMixedLinearFritschButlandCubic (QuantLib::Handle<QuantLib::MixedLinearFritschButlandCubic>& childNative, Object^ owner)  : CMixedLinearCubicInterpolation(CMixedLinearFritschButlandCubic::typeid)
{
	_phMixedLinearFritschButlandCubic = &childNative;
	_ppMixedLinearFritschButlandCubic = &static_cast<boost::shared_ptr<QuantLib::MixedLinearFritschButlandCubic>>(childNative.currentLink());
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearFritschButlandCubic));
    _MixedLinearFritschButlandCubicOwner = owner;
}
Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::CMixedLinearFritschButlandCubic (QuantLib::Handle<QuantLib::MixedLinearFritschButlandCubic> childNative)  : CMixedLinearCubicInterpolation(CMixedLinearFritschButlandCubic::typeid)
{
	_phMixedLinearFritschButlandCubic = &childNative;
	_ppMixedLinearFritschButlandCubic = &static_cast<boost::shared_ptr<QuantLib::MixedLinearFritschButlandCubic>>(childNative.currentLink());
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearFritschButlandCubic));
}
#endif
#ifdef STRUCT
Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::CMixedLinearFritschButlandCubic (QuantLib::MixedLinearFritschButlandCubic childNative)  : CMixedLinearCubicInterpolation(CMixedLinearFritschButlandCubic::typeid)
{
#ifdef HANDLE
	_phMixedLinearFritschButlandCubic = NULL;
#endif
	_ppMixedLinearFritschButlandCubic = new boost::shared_ptr<QuantLib::MixedLinearFritschButlandCubic> (new QuantLib::MixedLinearFritschButlandCubic (childNative));
    _ppMixedLinearCubicInterpolation = new boost::shared_ptr<QuantLib::MixedLinearCubicInterpolation> (boost::dynamic_pointer_cast<QuantLib::MixedLinearCubicInterpolation> (*_ppMixedLinearFritschButlandCubic));
}
#endif

Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::~CMixedLinearFritschButlandCubic ()
{
    if (_ppMixedLinearFritschButlandCubic != NULL)
    {
	    delete _ppMixedLinearFritschButlandCubic;
        _ppMixedLinearFritschButlandCubic = NULL;
    }
}
Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::!CMixedLinearFritschButlandCubic ()
{
    if (_ppMixedLinearFritschButlandCubic != NULL)
    {
	    delete _ppMixedLinearFritschButlandCubic;
    }
}
QuantLib::MixedLinearFritschButlandCubic& Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::GetReference ()
{
    if (_ppMixedLinearFritschButlandCubic == NULL) throw REFNEW NativeNullException ();
	return **_ppMixedLinearFritschButlandCubic;
}
boost::shared_ptr<QuantLib::MixedLinearFritschButlandCubic>& Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::GetShared ()
{
    if (_ppMixedLinearFritschButlandCubic == NULL) throw REFNEW NativeNullException ();
	return *_ppMixedLinearFritschButlandCubic;
}
QuantLib::MixedLinearFritschButlandCubic* Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::GetPointer ()
{
    if (_ppMixedLinearFritschButlandCubic == NULL) throw REFNEW NativeNullException ();
	return &**_ppMixedLinearFritschButlandCubic;
}
#ifdef HANDLE
QuantLib::Handle<QuantLib::MixedLinearFritschButlandCubic>& Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::GetHandle ()
{
	if (_phMixedLinearFritschButlandCubic == NULL)
	{
		_phMixedLinearFritschButlandCubic = new Handle<QuantLib::MixedLinearFritschButlandCubic> (*_ppMixedLinearFritschButlandCubic);
	}
	return *_phMixedLinearFritschButlandCubic;
}
#endif
bool Cephei::QL::Math::Interpolations::CMixedLinearFritschButlandCubic::HasNative () 
{
	return (_ppMixedLinearFritschButlandCubic != NULL);
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Factory class

